//go:build wireinject
// +build wireinject

package wirex

import (
	"background/db"
	"background/http/router"
	"background/utilx/ginx"
	"github.com/gin-gonic/gin"
	"github.com/google/wire"
)

func initChildRouter() ginx.RouterInits {
	panic(
		wire.Build(
			router.Provider,
			db.NewRedisMap,
			db.NewMysqlDB,
		))
}

func InitChildRouter(privateGroup *gin.RouterGroup) {
	//middleware.JWT(func(ctx *gin.Context) bool {
	//	return strings.Contains(ctx.Request.URL.Path, "login")
	//})
	hotel := privateGroup.Group("/")
	ginx.HandleRouterInit(hotel, initChildRouter()...)
}
